/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: 86187
 * Date: 2022-04-20
 * Time: 13:33
 */

//Scanner scan = new Scanner(System.in);

import java.util.Scanner;

public class TestDemo3 {

    /**
     * 模拟实现数组的拷贝
     * @param arr
     * @return
     */
    public static int[] copyArray(int[] arr) {
        int[] ret =new int[arr.length];

        for (int i = 0; i < arr.length; i++) {
            ret[i] = arr[i];
        }

        return ret;
    }

    public static void printArray(int[] arr) {

        for (int x:arr) {
            System.out.print(x+" ");
        }
    }

    public static void main(String[] args) {
        int[] array = {1,2,3,4,5,6,7};

        int[] arr = copyArray(array);

        printArray(arr);

    }
}
